import request from '@/utils/request'
// 获取车辆月卡列表
export const getCarMonthListApi = (params) => {
  return request({
    url: '/parking/card/list',
    params
  })
}
// 增加月卡
export const createCardApi = data => request({
  method: 'post',
  url: '/parking/card',
  data
})
// 查看月卡详情
export const getCardDetailApi = id => request({
  url: `/parking/card/${id}`
})

// 编辑月卡
export const updateCardApi = data => request({
  method: 'put',
  url: '/parking/card/edit',
  data
})

// 删除月卡
export const delCardApi = id => request({
  method: 'delete',
  url: `/parking/card/${id}`
})

/**
 * 批量删除月卡
 * @param {*} ids [1,2,3]
 * @returns
 */
export function delAllCardAPI(ids) {
  return request({
    url: `/parking/card/${ids.join(',')}`,
    method: 'DELETE'
  })
}
/**
 * 获取规则列表
 * @param { page, pageSize} params
 * @returns
 */
export function getRuleListApi(params) {
  return request({
    url: 'parking/rule/list',
    params
  })
}
